﻿<%@ Page Language="C#" AutoEventWireup="true" CodeFile="CCList.aspx.cs" Inherits="CCList"
    MasterPageFile="~/Default.master" EnableViewState="false" %>

<%@ Register Assembly="DevExpress.Web.v9.2, Version=9.2.9.0, Culture=neutral, PublicKeyToken=b88d1754d700e49a"
    Namespace="DevExpress.Web.ASPxCallback" TagPrefix="dxcb" %>
<%@ Register Assembly="DevExpress.Web.ASPxGridView.v9.2.Export, Version=9.2.9.0, Culture=neutral, PublicKeyToken=b88d1754d700e49a"
    Namespace="DevExpress.Web.ASPxGridView.Export" TagPrefix="dxwgv" %>
<%@ Register Assembly="DevExpress.Web.ASPxEditors.v9.2, Version=9.2.9.0, Culture=neutral, PublicKeyToken=b88d1754d700e49a"
    Namespace="DevExpress.Web.ASPxEditors" TagPrefix="dxe" %>            
<%@ Register Assembly="DevExpress.Web.ASPxGridView.v9.2, Version=9.2.9.0, Culture=neutral, PublicKeyToken=b88d1754d700e49a"
    Namespace="DevExpress.Web.ASPxGridView" TagPrefix="dxwgv" %>
<asp:Content ContentPlaceHolderID="head" ID="hd" runat="server" EnableViewState="false">

    <script src="CCList.js" type="text/javascript"></script>
    <script src="js/LOV.js" type="text/javascript"></script> 
    <script src="js/Datetimepicker.js" type="text/javascript"></script>
    
    <%--

    <script src="js/FileUpload.js" type="text/javascript"></script>
    

    
    <!-- TinyMCE -->

    <script src="js/tiny_mce.js" type="text/javascript"></script>

    <!-- /TinyMCE -->--%>
    <link href="CCList.css" rel="stylesheet" type="text/css" />
</asp:Content>
<asp:Content ContentPlaceHolderID="leftMenu" ID="leftnav" runat="server" EnableViewState="false">
<% Response.Write(GenerateSideMenu()); %>
</asp:Content>
<asp:Content ContentPlaceHolderID="content" ID="ctnCC" runat="server"
    EnableViewState="false">
    <div id="pnlCCTitle"></div>
    <div id="pnlCC" runat="server"></div> 
    <fieldset class="m_fs_border" id="fs_CCView">
        <legend><a class="lnk" href="javascript:toggle('CCList');">Call List</a>
        </legend>
        <dl class="m_fs">
            <div id="div_CCList">
            
            <dxwgv:ASPxGridView ID="dgCallView" KeyFieldName="T_COURTESY_CALL_ID" ClientInstanceName="dgCallView_c"
                runat="server" AutoGenerateColumns="false" Width="100%" Font-Size="Small"
                 OnCustomCallback="dgCallView_CustomCallback">
                <Styles Header-HorizontalAlign="Center" AlternatingRow-Enabled="True" Cell-Wrap="true" Cell-Font-Size="Smaller" Header-Wrap="true"
                    Header-Font-Size="Smaller" Header-Font-Bold="true">
                    <Header Wrap="True" Font-Size="Smaller" Font-Bold="True">
                    </Header>
                    <AlternatingRow Enabled="True">
                    </AlternatingRow>
                    <Cell Wrap="True" Font-Size="Smaller">
                    </Cell>
                </Styles>
                <SettingsPager PageSize="10">
                </SettingsPager>
                <Settings ShowFilterBar="Visible" ShowFilterRow="true" ShowFilterRowMenu="true" ShowHorizontalScrollBar="true" />
                <SettingsBehavior AllowSort="true" />
                <ClientSideEvents EndCallback="function(s, e) { dgCallView_c_CallbackComplete(e); }" />
                <Templates >
                        <EditForm>
                        Isi Alasan Pembatalan: <input type="text" ID="reasonEditor" value='<%# Eval("CANCELATION_REASON")%>' />
                        <input type="button" class="btn" ID="btnCA" value='Batal' onclick="DoCancel('<%# Eval("T_COURTESY_CALL_ID")%>');" />
                        <dxwgv:ASPxGridViewTemplateReplacement ID="CancelButton" ReplacementType="EditFormCancelButton"
                                    runat="server" >
                                </dxwgv:ASPxGridViewTemplateReplacement>
                        </EditForm>
                    </Templates>
                <Columns>
                    <dxwgv:GridViewDataTextColumn FieldName="T_COURTESY_CALL_ID" Name="T_COURTESY_CALL_ID" 
                        Caption="COURTESY CALL ID" Visible="false" >
                        <EditFormSettings Visible="False" />
                    </dxwgv:GridViewDataTextColumn>
                    <dxwgv:GridViewDataTextColumn FieldName="COMPANY_NAME" Name="COMPANY_NAME" Caption="COMPANY" >
                        <DataItemTemplate>
                        <%# GridColumnManager.GetCompanyLinkColumn(Eval("CUSTOMER_ID").ToString(), Eval("COMPANY_NAME").ToString())%>
                        </DataItemTemplate>
                        <EditFormSettings Visible="False" />
                    </dxwgv:GridViewDataTextColumn>
                    <dxwgv:GridViewDataTextColumn FieldName="CAR" Name="CAR" Caption="CAR" >
                        <DataItemTemplate>
                        <%# GridColumnManager.GetCARLinkColumn(Eval("EMPLOYEE_NO").ToString(),Eval("CAR").ToString())%>
                        </DataItemTemplate>
                        <EditFormSettings Visible="False" />
                    </dxwgv:GridViewDataTextColumn>
                    <dxwgv:GridViewDataTextColumn FieldName="NAME" Name="NAME" Caption="CONTACT PERSON" >
                        <EditFormSettings Visible="False" />
                    </dxwgv:GridViewDataTextColumn>
                    <dxwgv:GridViewDataDateColumn FieldName="PLANNED_DATE" Name="PLANNED_DATE" Caption="PLANNED DATE"
                     PropertiesDateEdit-DisplayFormatString="dd-MMM-yyyy HH:mm:ss" >
                        <EditFormSettings Visible="False" />
                    </dxwgv:GridViewDataDateColumn>
                    <dxwgv:GridViewDataTextColumn FieldName="CALL_STATUS" Name="CALL_STATUS" Caption="CALL STATUS" >
                        <EditFormSettings Visible="False" />
                    </dxwgv:GridViewDataTextColumn>
                    <dxwgv:GridViewDataTextColumn Caption="VIEW" Name="VIEW" CellStyle-HorizontalAlign="Center">
                        <DataItemTemplate>
                        <a href="CCView.aspx?ccid=<%# Eval("T_COURTESY_CALL_ID").ToString() %>">View</a>
                        </DataItemTemplate>
                        <EditFormSettings Visible="False"/>
                    </dxwgv:GridViewDataTextColumn>
                    <dxwgv:GridViewDataTextColumn Caption="EDIT" Name="EDIT" CellStyle-HorizontalAlign="Center">
                        <DataItemTemplate>
                        <a href="javascript:EditPlannedDate('<%# Eval("T_COURTESY_CALL_ID").ToString() %>');">Edit</a>
                        </DataItemTemplate>
                        <EditFormSettings Visible="False"/>
                    </dxwgv:GridViewDataTextColumn>
                    <dxwgv:GridViewDataTextColumn Caption="REALIZE" Name="REALIZE" CellStyle-HorizontalAlign="Center">
                        <DataItemTemplate>
                        <a href="CCReal.aspx?ccid=<%# Eval("T_COURTESY_CALL_ID").ToString() %>">Realize</a>
                        </DataItemTemplate>
                        <EditFormSettings Visible="False"/>
                    </dxwgv:GridViewDataTextColumn> 
                    <dxwgv:GridViewCommandColumn Name="CANCEL_CALL" EditButton-Visible="true" EditButton-Text="Cancel Call" />
                    <dxwgv:GridViewDataTextColumn FieldName="CANCELATION_REASON" Name="CANCELATION_REASON"
                     Caption="CANCELATION REASON" Width="50" Visible = "false">
                        <EditFormSettings Caption="Isi Alasan Reject: " />
                    </dxwgv:GridViewDataTextColumn>   
                </Columns>
            </dxwgv:ASPxGridView>
            <dxwgv:ASPxGridViewExporter ID="dgExporter" GridViewID="dgCallView" runat="server">
                </dxwgv:ASPxGridViewExporter>
                <dxe:ASPxButton ID="btnExport" runat="server" Text="Save To XLS" UseSubmitBehavior="false"
                    OnClick="btnExport_Click" ClientInstanceName="btnExport_c" Image-Url="images/excel.png" 
                    Width="120px" Height="20px" HorizontalAlign="Left">
                </dxe:ASPxButton>
            </div>
        </dl>
    </fieldset>
    <dxcb:ASPxCallback ID="cbkList" ClientInstanceName="cbkList_c" runat="server" OnCallback="cbkList_Callback">
        <ClientSideEvents CallbackComplete="function(s, e) { cbkList_c_CallbackComplete(e); }" />
    </dxcb:ASPxCallback>   
</asp:Content>
